﻿using System;
using System.Collections;
using System.Collections.Generic;
using GeoAPI.Geometries;

namespace NetTopologySuite.Geometries
{
	[Serializable]
	public class MultiPoint : GeometryCollection, IMultiPoint, IGeometryCollection, IGeometry, ICloneable, IComparable, IComparable<IGeometry>, IEquatable<IGeometry>, IEnumerable<IGeometry>, IEnumerable, IPuntal
	{
		public MultiPoint(IPoint[] points, IGeometryFactory factory) : base(points, factory)
		{
		}

		public MultiPoint(IPoint[] points) : this(points, Geometry.DefaultFactory)
		{
		}

		public override Dimension Dimension
		{
			get
			{
				return Dimension.Point;
			}
		}

		public override Dimension BoundaryDimension
		{
			get
			{
				return Dimension.False;
			}
		}

		public override string GeometryType
		{
			get
			{
				return "MultiPoint";
			}
		}

		public override OgcGeometryType OgcGeometryType
		{
			get
			{
				return OgcGeometryType.MultiPoint;
			}
		}

		public override IGeometry Boundary
		{
			get
			{
				return base.Factory.CreateGeometryCollection(null);
			}
		}

		public override bool IsValid
		{
			get
			{
				return true;
			}
		}

		public override bool EqualsExact(IGeometry other, double tolerance)
		{
			return this.IsEquivalentClass(other) && base.EqualsExact(other, tolerance);
		}

		protected Coordinate GetCoordinate(int n)
		{
			return base.Geometries[n].Coordinate;
		}

		public new static readonly IMultiPoint Empty = new GeometryFactory().CreateMultiPoint(new IPoint[0]);
	}
}
